package com.qingcloud.adminbackend.base;

import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

public class TablePage implements Serializable {

    @ApiModelProperty(value = "起始页(从0开始)", example = "0")
    private Integer start;

    @ApiModelProperty(value = "每页显示记录数)", example = "10")
    private Integer length;

    public Integer getStart() {
        return this.start;
    }

    public void setStart(Integer start) {
        this.start = start;
    }

    public Integer getLength() {
        return this.length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    public Integer getPageNumber() {
        if(this.getStart().intValue() == 0) {
            return Integer.valueOf(0);
        } else {
            int p = this.getLength().intValue() / this.getStart().intValue();
            return Integer.valueOf(p);
        }
    }
}
